package com.push.xu.xpush.entity;

import android.os.Parcel;
import android.os.Parcelable;


public class PushCommand implements Parcelable {

    private String token;

    private String extraMsg;

    private String error;

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getExtraMsg() {
        return extraMsg;
    }

    public void setExtraMsg(String extraMsg) {
        this.extraMsg = extraMsg;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }

    @Override
    public String toString() {
        return "OnePushCommand{" +
//                "type=" + getTypeText(type) +
                ", token='" + token + '\'' +
                ", extraMsg='" + extraMsg + '\'' +
                ", error='" + error + '\'' +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.token);
        dest.writeString(this.extraMsg);
        dest.writeString(this.error);
    }

    public PushCommand() {
    }

    public PushCommand(String token, String extraMsg, String error) {
        this.token = token;
        this.extraMsg = extraMsg;
        this.error = error;
    }

    protected PushCommand(Parcel in) {
        this.token = in.readString();
        this.extraMsg = in.readString();
        this.error = in.readString();
    }

    public static final Creator<PushCommand> CREATOR = new Creator<PushCommand>() {
        @Override
        public PushCommand createFromParcel(Parcel source) {
            return new PushCommand(source);
        }

        @Override
        public PushCommand[] newArray(int size) {
            return new PushCommand[size];
        }
    };

//    private String getTypeText(int type) {
//        String typeText = null;
//        switch (type) {
//            case TYPE_REGISTER:
//                typeText = "TYPE_REGISTER";
//                break;
//
//            case TYPE_UNREGISTER:
//                typeText = "TYPE_UNREGISTER";
//                break;
//
//            case TYPE_ADD_TAG:
//                typeText = "TYPE_ADD_TAG";
//                break;
//            case TYPE_DEL_TAG:
//                typeText = "TYPE_DEL_TAG";
//                break;
//
//            case TYPE_BIND_ALIAS:
//                typeText = "TYPE_BIND_ALIAS";
//                break;
//
//            case TYPE_UNBIND_ALIAS:
//                typeText = "TYPE_UNBIND_ALIAS";
//                break;
//        }
//        return typeText;
//
//    }

}
